<template>
  <div>
    <!-- 用户权限 -->
    <div class="model">
      <div class="tools">
        <el-button @click="add">添加</el-button>
      </div>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="name" label="姓名"> </el-table-column>
        <el-table-column width="250" align="center" label="操作">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="primary"
              >查看</el-button
            >
            <el-button @click="edit(scope.row)" type="warning">编辑</el-button>
            <el-button @click="del(scope.row)" type="danger">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: []
    };
  },
  methods: {
    getData() {
      this.$http
        .get(this.$baseUrl.searchAdmin, {
          params: {
            pop: "3"
          }
        })
        .then(res => {
          console.log(res);
          this.tableData = res.data;
        })
        .catch(err => {
          console.log(err);
        });
    },
    add() {},
    handleClick(obj) {
      console.log(obj);
    },
    edit(obj) {
      console.log(obj);
    },
    del(obj) {
      console.log(obj);
    }
  },
  mounted() {
    this.getData();
  }
};
</script>

<style scoped lang="scss">
.model {
  .tools {
    padding: 30px 0;
    border-bottom: 1px solid #999;
    margin-bottom: 30px;
  }
}
</style>
